//
//  mySettingCells.swift
//  LeDian
//
//  Created by 三秒文化 on 16/3/22.
//  Copyright © 2016年 51ledian. All rights reserved.
//

import UIKit

class baseMySettingCells: UITableViewCell {

    var titleLab:UILabel?
    var descLab:UILabel?
    var imageMarkImgView:UIImageView?
    var divideLine:UIView?
    
    var model:baseMySettingCellsModel? {
        didSet{
            titleLab?.text = model!.title
            descLab?.text = model!.desc
        }
    }
    
    override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        setDefaultContent()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    func setDefaultContent() {
        self.selectionStyle = UITableViewCellSelectionStyle.None
        titleLab = UILabel.setDetailsLab("设置", fontSize: 15, titleColor: LDFontColor.Black,Alignment: nil)
        imageMarkImgView = UIImageView.init(image: UIImage.init(named: "箭头"))
        descLab = UILabel.setDetailsLab("", fontSize: 14, titleColor: LDFontColor.Green, Alignment: .Right)
        divideLine = UIView.init()
        divideLine!.backgroundColor = LDLineColorLightGray
        
        addSubview(descLab!)
        addSubview(divideLine!)
        addSubview(titleLab!)
        addSubview(imageMarkImgView!)
        
        titleLab?.snp_makeConstraints(closure: { (make) in
            make.left.equalTo(Margin_V*4)
            make.centerY.equalTo(self)
            make.width.equalTo(220)
        })
        imageMarkImgView?.snp_makeConstraints(closure: { (make) in
            make.right.equalTo(-Margin_V*3)
            make.centerY.equalTo(self)
            make.height.equalTo(15)
            make.width.equalTo(10)
        })
        descLab?.snp_makeConstraints(closure: { (make) in
            make.right.equalTo((imageMarkImgView?.snp_left)!).offset(-LDMargin_V)
            make.centerY.equalTo(imageMarkImgView!)
            make.height.equalTo(15)
            make.width.equalTo(120)
        })
        divideLine!.snp_makeConstraints { (make) in
            make.bottom.equalTo(self).offset(-0.5)
            make.left.equalTo(LDMargin_V)
            make.right.equalTo(-LDMargin_V)
            make.height.equalTo(0.5)
        }
        
    }

    override func setSelected(selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)
        
    }
}
class baseMySettingCellsModel: NSObject {
    var title:String?
    var desc:String?
}
